import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import AutoImport from 'unplugin-auto-import/vite'
import { fileURLToPath, URL } from 'node:url'

// https://vite.dev/config/
export default defineConfig({
  resolve: {
    alias: {
      '@': fileURLToPath(new URL('./src', import.meta.url)),
    },
  },
  plugins: [
    vue(),
    AutoImport({
      imports: ['vue', 'vue-router'],
      // dirs: ['./src/api', './src/stores', './src/hooks', './libs/jax/jax-node/stores'], // 自动导入
      dts: './src/auto-imports.d.ts',
      dirs: ['./src/libs/jax/jax-node/stores', './src/ui/stores'],
    }),
  ],
  server: {
    // host: '0.0.0.0',
    port: 1001,
  },
})
